package org.wzl.todolisthelper.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.wzl.todolisthelper.json.PeriodicTaskDetailJsonDeserialize;

import java.time.LocalDateTime;

@Data
public class AddPeriodicTaskDTO {

    /**
     * 任务名称
     */
    @NotEmpty(message = "任务名称不能为空")
    private String taskName;

    /**
     * 任务重复周期（每天、每周、每个月）
     * @see org.wzl.todolisthelper.enumerate.PeriodicTaskRepetitionCycleEnum
     */
    @NotEmpty(message = "任务重复周期不能为空")
    private String repetitionCycle;

    /**
     * 任务详情
     */
    private Object periodicTaskDetail;

    private Object periodicTaskOfDay;
    private Object periodicTaskOfMonth;
    private Object periodicTaskOfWeek;

    /**
     * 任务开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startDate;

    /**
     * 任务结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endDate;

    @NotNull(message = "任务是否重复不能为空")
    private Integer taskRepeat;

    private Integer repeatCount;

}
